<!doctype html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>jQT.Location</title>
        <style type="text/css" media="screen">@import "../../jqtouch/jqtouch.min.css";</style>
        <style type="text/css" media="screen">@import "../../themes/jqt/theme.min.css";</style>
        <script src="../../jqtouch/jquery.1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../jqtouch/jqtouch.min.js" type="application/x-javascript" charset="utf-8"></script>
        <script src="../../extensions/jqt.location.js" type="application/x-javascript" charset="utf-8"></script>


        <script type="text/javascript" charset="utf-8">
            var jQT = new $.jQTouch({
                icon: 'jqtouch.png',
                addGlossToIcon: false,
                startupScreen: 'jqt_startup.png',
                statusBar: 'black'
            });

            $(function(){
                function setDisplay(text) {
                    $('.info').empty().append(text)
                }
                
                // We pass "updateLocation" a callback function,
                // to run once we have the coordinates.
                // We also set it to a variable, so we can know
                // right away if it's working or not
                var lookup = jQT.updateLocation(function(coords){
                    if (coords) {
                        setDisplay('Latitude: ' + coords.latitude + '<br />Longitude: ' + coords.longitude);
                    } else {
                        setDisplay('Device not capable of geo-location.');
                    }
                });

                if (lookup) {
                    setDisplay('Looking up location&hellip;');
                }
            });
        </script>

    </head>
    <body>
        <div>
            <div class="toolbar">
                <h1>Geo Location</h1>
            </div>
            <div class="info"></div>
        </div>
    </body>
</html>